<%#*ticketslk events calendar index%>
<body>
<%= javascript_include_tag "wz_tooltip"   %>
  <link rel="stylesheet" href="/stylesheets/calendar/blue/style.css">


  <script type='text/javascript'>
    function displaymessage(date)
    {
      location.href='/events_details?timeframe=day&date='+'<%=@year%>'+'-'+'<%=@month%>'+'-'+date;
    }

    function cellOver(cellOb,cellText)
    {
      var tooltip="";
      var films="";
      var others="";
      var holidays="";

<%@event_ob.sort_by {|u| u.start}.each{|r|%>

  <%dateTimeStart=DateTime.parse(r.start.to_s)%>
  <%dateTimeEnd=DateTime.parse(r.end.to_s)%>

      var cell="<%=dateTimeStart.mday%>";

      if(cell==cellText){







  <%if r.event_type=="film"%>
          films=films+"<font size='2'><b> <%=r.title %></b><br> "+

            " Description : <%=r.content.to_s %></font><br><br>"

  <%else%>

     <%if r.event_type=="holiday"%>
          holidays=holidays+"<font size='2'><b> <%=r.title %></b><br><br>"

    <%else%>

            others=others+"<font size='2'><b><%=dateTimeStart.strftime("%I:%M%p") %>"+
            "<%=dateTimeEnd.strftime(" to %I:%M%p") %> : <%=r.title %></b><br> Location : "+
            "<%=r.where %><br> Description : <%=r.content.to_s %></font><br><br>"
    <%end%>


  <%end%>



      }
<%} if not @event_ob.nil? %>

    if (holidays!=""){
      tooltip=tooltip+"<font size='3' STYLE='text-decoration:underline'><b>Holidays</b></font><br>"+holidays
    }

    if (films!=""){
      tooltip=tooltip+"<font size='3' STYLE='text-decoration:underline'><b>Films</b></font><br>"+films
    }
    if (others!=""){
      tooltip=tooltip+"<font size='3' STYLE='text-decoration:underline'><b>Parties,Concerts and Others</b></font><br>"+others
    }

    if(tooltip!=""){
      Tip(tooltip);
    }



<%#*cellOb.style.backgroundColor='#ffffff';%>

  }
  function colorChangeOut(cellOb)
  {
<%#*hideddrivetip();%>

  }

  </script>

 <h3 style="font-size:1.2em;color:black">Events Calendar</h3>
<table border="1">
  <tr>
    <td style="background-color:#F0F0F0" class="cal_container" >

      <%=calendar(:previous_month_text   => "&lt;&lt;Prev",:next_month_text   =>"Next&gt;&gt;",:year => @year.to_i, :month => @month.to_i) do |d|

        if not @films.nil? and @films.include?(d)

          if not @events.nil? and @events.include?(d)
            [d.mday, {:class => "film_and_event"}]
          else
            [d.mday, {:class => "specialDay_film"}]
          end


        else
          if not @events.nil? and @events.include?(d)
            [d.mday, {:class => "specialDay",:style=>"background-color:blue"}]
          else
            if not @holidays.nil? and @holidays.include?(d)
              [d.mday, {:class => "holiday"}]
            end
          end
        end



      end
    %>
    </td>
  </tr>
  <tr>
    <td>
       <%#*<ul style="font-size:11px">%>
              <%#*<li style="color:blue">&yen; Today%>
              <%#*<li style="color:orange">&yen; Holidays%>
              <%#*<li style="color:green">&yen; Movies Starting Dates%>
              <%#*<li style="color:red">&yen; Parties,Concerts and Others%>

       <%#*</ul>%>
       <table style="font-size:0.8em">
          <tr>
            <td style="color:blue;" width="60" >&yen; Today</td>
            <td style="color:green">&yen; Movies Starting Dates</td>
          </tr>
          <tr>
            <td style="color:orange">&yen; Holidays</td>
            <td style="color:red">&yen; Parties,Concerts and Others</td>
          </tr>
       </table>

       <hr style="color:#F0F0F0">
    </td>
  </tr>

</table>
</body>